// 审核凭证
const {DataTypes, db } = require("../db");
db.define('card', {
id: {type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true,comment:'表自增ID'},
tenantId:{type: DataTypes.INTEGER,allowNull:false,comment:'租户ID'}, 
billState:{type: DataTypes.STRING(20),allowNull:false,comment:'单据状态 draft,accounted,wasted,deleted'}, 
billNo:{type: DataTypes.STRING(128),allowNull:false,comment:'单据编号'}, 
billDate:{type: DataTypes.STRING(10),allowNull:false,comment:'单据草稿日期'}, 
remark:{type: DataTypes.STRING(1000),defaultValue:(''),comment:'备注'},
subRemark:{type: DataTypes.STRING(255),defaultValue:(''),comment:'子表备注'}, 
isHc:{type: DataTypes.INTEGER,defaultValue:0,comment:'红冲 0/1'}, 
isAuto:{type: DataTypes.INTEGER,defaultValue:0,comment:'系统自动生成票据1'}, 
printNo:{type: DataTypes.INTEGER,defaultValue:0,comment:'打印次数'}, 
byCell:{type: DataTypes.INTEGER,defaultValue:0,comment:'手机下单1'}, 
disabled:{type: DataTypes.TINYINT,defaultValue:0,comment:'作废0/1'}, 
byIid:{type: DataTypes.INTEGER,defaultValue:0,comment:'生成该票据的票据ID'}, 
files:{type: DataTypes.INTEGER,defaultValue:0,comment:'附件张数'}, 
isDelete:{type: DataTypes.TINYINT,defaultValue:0,comment:'1删除  0正常'}, 
wastedBy:{type: DataTypes.INTEGER,defaultValue:0,comment:'红冲人'}, 
wastedAt:{type: DataTypes.STRING(20),defaultValue:(''),comment:'红冲时间'}, 
accountedAt:{type: DataTypes.STRING(20),defaultValue:(''),comment:'审核时间'},
accountedBy:{type: DataTypes.INTEGER,defaultValue:0,comment:'审核人ID'},
cby:{type: DataTypes.INTEGER,defaultValue:0,comment:'制单人'}, 
deletedAt:{type: DataTypes.STRING(20),defaultValue:(''),comment:'删除时间'}, 
deletedBy:{type: DataTypes.INTEGER,defaultValue:0,comment:'删除人'}, 
createdAt:{type: DataTypes.STRING(20),allowNull:false,defaultValue:(''),comment:'创建时间'}, 
updatedAt:{type: DataTypes.STRING(20),comment:''}, 
buId:{type: DataTypes.INTEGER,defaultValue:0,comment:'往来单位ID'}, 
buName:{type: DataTypes.STRING(255),defaultValue:(''),comment:'往来单位名称'}, 
srcBillNo:{type: DataTypes.STRING(20),comment:''}, 
oldBillNo:{type: DataTypes.STRING(36),comment:''}, 
isJz:{type: DataTypes.INTEGER,defaultValue:0,comment:'结转凭证'}, 
zqId:{type: DataTypes.INTEGER,comment:'账期ID'}, 
updatedBy:{type: DataTypes.INTEGER,comment:''}, 

}, {
    tableName: 'card',
    timestamps: false,
    comment: '凭证'
});